load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_zig//zig:defs.bzl", "zig_binary")

zig_binary(
    name = "modernbert",
    srcs = ["modernbert.zig"],
    args = [
        "--model=$(location @ModernBERT-base//:model.safetensors)",
        "--tokenizer=$(location @ModernBERT-base//:tokenizer.json)",
        "--num-attention-heads=12",
        "--tie-word-embeddings=true",
    ],
    data = [
        "@ModernBERT-base//:model.safetensors",
        "@ModernBERT-base//:tokenizer.json",
    ],
    main = "main.zig",
    deps = [
        "//async",
        "//stdx",
        "//zml",
        "@com_github_hejsil_clap//:clap",
    ],
)

# zig_cc_binary(
#     name = "test-implementation",
#     srcs = ["modernbert.zig"],
#     args = [
#         "--model=$(location @ModernBERT-base//:model.safetensors)",
#     ],
#     data = [
#         "@ModernBERT-base//:model.safetensors",
#     ],
#     main = "test.zig",
#     deps = [
#         "//async",
#         "//zml",
#         "@com_github_hejsil_clap//:clap",
#     ],
# )

build_test(
    name = "test",
    targets = [":modernbert"],
)
